package chain_of_responsibility_pattern.v2;

/**
 * 总经理类
 * @author ricejson
 */
public class GeneralManager extends Manager {
    public GeneralManager(String name) {
        super(name);
    }

    @Override
    public void handleRequest(Request request) {
        // 处理总经理相关的请求
        if (request.getRequestType().equals("请假")) {
            // 请假
            System.out.println(name + ":" + request.getRequestContent() + " 数量" + request.getRequestNum() + "被批准");
        } else if (request.getRequestType().equals("加薪") && request.getRequestNum() <= 500) {
            // 加薪<=500
            System.out.println(name + ":" + request.getRequestContent() + " 数量" + request.getRequestNum() + "我无权处理");
        } else if (request.getRequestType().equals("加薪") && request.getRequestNum() > 500) {
            // 加薪<=500
            System.out.println(name + ":" + request.getRequestContent() + " 数量" + request.getRequestNum() + "再说吧");
        }
    }
}
